package practice4;

public class MovablePoint extends Point {
	float xSpeed = 0.0f;
	float ySpeed = 0.0f;
	
    public MovablePoint(float x, float y,float xSpeed, float ySpeed){
    	this.x = x;
		this.y = y;
		this.xSpeed = xSpeed;
		this.ySpeed = ySpeed;
	}
	
    public MovablePoint(float xSpeed, float ySpeed){
		this.xSpeed = xSpeed;
		this.ySpeed = ySpeed;
	}
    
    public float getXSpeed(){
    	return xSpeed;
    }
    
    public float getYSpeed(){
    	return ySpeed;
    }
    
    public float[] getSpeed(){
    	float[] Speed = new float[2];
    	Speed[0] = xSpeed;
    	Speed[1] = ySpeed;
    	return Speed;
    }
    
    public void setXSpeed(float xSpeed){
    	this.xSpeed = xSpeed;
    }
    
    public void setYSpeed(float ySpeed){
    	this.ySpeed = ySpeed;
    }
    
    public void setSpeed(float xSpeed, float ySpeed){
    	this.xSpeed = xSpeed;
    	this.ySpeed = ySpeed;
    }
    
    public String toString(){
    	return "( " + x + " , " + y + " ), speed = (" + xSpeed + " , " + ySpeed + ")";
    }
    
    public MovablePoint move(){
    	x += xSpeed;
    	y += ySpeed;
    	return this;
    }


}
